As prior art methods of using a media exchange type storage device represented by an optical disk library as an external storage device, there have been known two methods; a method which is basically equivalent to a method of utilizing external optical disk drives and has a means for automatically mounting an optical disk (storage medium) to be accessed, in an optical disk drive (data access device) as the only feature, and a method disclosed by Japanese Published Patent Application No. Hei. 7-93110, in which a plurality of optical disks are virtually treated as a single storage device.
In both of the methods, a prior art data writing process to an external storage device is used for data writing to an optical disk serving as a storage medium.
The prior art data writing process to an external storage device is disclosed in detail by Japanese Published Patent Application No. Hei. 4-225441.
As methods for locating file data on a storage medium, there are a data block allocation method and a continuous region allocation method.
The data block allocation method comprises dividing a storage medium into data blocks of fixed capacity, generally, a few hundreds of bytes to a few kilobytes, and writing data to the storage medium while successively allocating unused data blocks to the data. In this data block allocation method, when data of one file are written to plural data blocks, the positional relationships between the used data blocks are not considered. In this method, storage positions of a file are generally managed as a list of data block numbers (data block addresses) assigned to respective data blocks.
Meanwhile, in the continuous region allocation method, storage positions of a file are managed according to a top address and a length of data.
In the data block allocation method, since storage regions for respective blocks are allocated even when file writing and partial erasure are repeated, the storage regions can be effectively utilized. However, data of a file must be extracted from data blocks which are disorderedly located in several parts of a storage medium, so that it takes time to read the file.
In the continuous region allocation method, since data of a file are located continuously, file reading can be carried out at high speed. However, when file writing and partial erasure are repeated, continuous unused storage regions enough for file storage are not found although many unused storage regions remain, so that many useless storage regions are produced.
Conventiornally, it has been taken for granted that the continuous region allocation method is used for an optical disk, in order to read multimedia data, such as voice data and moving picture data, at high speed and perform processing in real time. In recent years, however, even when the data block allocation method is used for an optical disk, an improvement of reading performance has made processing in real time possible.
Further, effective use of storage regions of an optical disk of mass storage has been regarded as important, and the data block allocation method has been generally used for an optical disk.
A description is given of a data block allocation method in a prior art information processor in which a plurality of optical disks in an optical disk library are virtually treated as a single storage device, with reference to FIGS. 1, 2, 3, 4 and 5(a) and 5(b) which show component parts common with a file management apparatus according to a first embodiment of the present invention, and FIG. 24 which shows the operation of the prior art information processor.
FIG. 1 is a block diagram illustrating a general construction of an information processor in which a plurality of optical disks in an optical disk library are virtually treated as a single storage device.
In FIG. 1, an information processor 1 has an optical disk library 300 as an external storage device, and includes a file management apparatus 2. The file management apparatus 2 comprises a file managment unit 100 and a disk management unit 200.
The file management unit 100 comprises a data block management unit 110 for managing data blocks and a data block allocation unit 120 for allocating data blocks to files. The data block management unit 110 has a data block management table 111 illustrated in FIG. 2, and the data block allocation unit 120 has a file management table 121 illustrated in FIG. 3.
The disk management unit 200 comprises a virtual disk management unit 210 and an optical disk library control unit 220. The virtual disk management unit 210 has a data block corresponding table 211 illustrated in FIG. 4, and the optical disk library control unit 220 has an optical disk management table 221 illustrated in FIGS. 5(a) and 5(b).
The optical disk library 300 includes optical disk drives D0 to D3 serving as data access devices, optical disks M0 to M9 serving as storage media, and an optical disk exchanging device 310 for mounting the optical disks in the optical disk drives D0 to D3 according to requests from the outside.
FIG. 24 is a flow chart showing the operation of the information processor for virtually treating the plurality of optical disks in the optical disk library as a single storage device.
A description is given of the operation of the information processor thus constructed, with reference to FIG. 24.
When the file management unit 100 in the file management apparatus 2 receives a writing request of a file, at step S1201, the data block management unit 110 examines whether unused data blocks are present or not, using the data block management table 111.
When no unused data blocks are present, no file can be stored. Therefore, the writing process is completed as a file writing error due to shortage of the capacity (step S1207).
When the unused data blocks are present, step S1202 is executed, The data block management unit 110 selects one unused data block from the data block management table 111, and updates the data block management table 111, i.e., changes the use flag of the selected data block to "used". For example, the data block with the number "2" is selected from the data block management table 111 shown in FIG. 2, and the use flag of the data block with the number "2" is changed to "used".
Then, at step S1203, the data block allocation unit 120 allocates the selected data block as a data storage block for the file to be written, and updates the file management table 121. For example, when the file 3 is additionally written in the file management table 121 shown in FIG. 3, the data block number "2" of the data block selected at step S1202 is added to the used data block number list of the file 3, and the used data block number list of the file 3 is changed to "4, 2". When a new file which has been not recorded in the file management table 121, for example, a file 10, is written, a new field for the file 10 is created in the file management table 121, and the used data block number list of the field is made "2".
Subsequently, at step S1204, the file management unit 100 instructs the disk management unit 200 to write the file data to the allocated data block. When the disk management unit 200 receives this instruction, using the data block corresponding table 211, the disk management unit 200 obtains an optical disk number of an optical disk having the data block to which the file data is to be written, and calculates a real data block number of the data block on the optical disk, by the virtual disk management unit 210.
In this case, since the data block with the number "2" is on the optical disk M0, the real data block number of the data block on the optical disk M0 is "2" (2-0=2).
Then, using the optical disk management table 221, the disk management unit 200 selects an optical disk drive used in file data writing by the optical disk library control unit 220, and instructs the optical disk library 100 to mount the optical disk for file writing in the selected optical disk drive. When the optical disk library 300 receives this instruction, the optical disk library 300 mounts the optical disk in the optical disk drive according to the instruction, by the optical disk exchanging device 310.
Usually, as this selection method, it is first examined whether the optical disk for file writing is mounted in any of the optical disk drives or not. When the optical disk for file writing has been mounted in the optical disk drive, that optical disk drive is selected and the optical disk is left as it is. When the optical disk for file writing is mounted in none of the optical disk drives, the disk management unit 200 finds out and selects the optical disk drive in which no other optical disk is mounted, and instructs the optical disk library 300 to mount the optical disk for file writing in the selected optical disk drive. If the disk management unit 200 does not. find out the optical disk drive in which no other optical disk is mounted, the disk management unit 200 selects the optical disk drive having the oldest command accept time, and instructs the optical disk library 300 to return the optical disk mounted in the selected optical disk drive to its storage slot and then to mount the optical disk for file writing in the slected optical disk drive.
By using such a selection method, time required for exchanging optical disks is shortened and processing time is evenly allocated to each file access.
Thereafter, using the selected optical disk drive in the optical disk library 300, the disk management unit 200 writes the file data to the data block with the real data block number "2" on the optical disk M0 which is mounted in the optical disk drive, by the optical disk library control unit 220.
Then, at step S1205, the file management unit 100 examines whether the file data to be further written remains or not.
When the data to be written remains, the writing process returns to step S1201, and block allocation/file writing processes are repeated until all the data is written.
When no data to be written remains, the file writing process is completed (step S1206).
As in the information processor described above, however, when a media exchange type storage device, such as an optical disk library, is utilized, access performance of an optical disk serving as a storage medium is deteriorated as compared with that of a usual hard disk, arid processing required for exchanging optical disks adversely affects the performance of the data access.
Further, in the prior are data block allocation method, selection of data blocks to be allocated to a file is not taken into consideration. Therefore, there is a case where optical disks must be exchanged many times at access to the file, in a manner that a top data of the file is stored in the first optical disk and a next data of the file is stored in the second optical disk, so that it is difficult to use the data block allocation method for file reading in real time.
Still further, when plural file writing processes are simultaneously performed to one optical disk, the files scramble for data blocks on the optical disk, whereby all the data blocks on the optical disk are used up immediately and the remaining data of the files are written to a next optical disk, resulting in an increase in exchange of optical disks Consequently, in order to write files which is readable in real time, the plural simultaneous writing processes cannot be allowed.
Still further, when a file is written to an optical disk from which another file is being read, the limit of the access performance of the optical disk deteriorates reading performance, so that reading in real time cannot be realized. Consequently, it is impossible that file reading and file writing coexist.
Still further, when a file is written to an optical disk which is not mounted in an optical disk drive, the optical disk for writing is mounted to an optical disk drive. At this time, there is a case where an optical disk that is being currently accessed is dismounted from an optical disk drive and the optical disk for writing is mounted therein. In this case, the access to the optical disk which has been dismounted from the optical disk drive is suspended, so that the access takes time above required.
Furthermore, the operation of remounting the optical disk in the optical disk drive after the suspended access coexists with the operation of mounting the optical disk for writing in the optical disk drive, whereby exchange of the optical disks is repeated many times, resulting in incompletion of the previous access and the writing.